package com.base.system.managedBean;

import java.util.Map;

import javax.faces.context.FacesContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.operamasks.faces.annotation.BeforeRender;
import org.operamasks.faces.annotation.Inject;
import org.operamasks.faces.annotation.ManagedBean;
import org.operamasks.faces.annotation.ManagedBeanScope;

import com.base.organization.entity.CentralUnit;
import com.base.security.SecurityConst;
import com.base.system.managedBean.baseBean.BaseCentralUnitBean;

/**
 * 
 * This managed bean is generated automatically
 */
@ManagedBean(name = "system_showCentralUnitBean", scope = ManagedBeanScope.REQUEST)
public class ShowCentralUnitBean extends BaseCentralUnitBean {
	private final static Log logger = LogFactory
			.getLog(ShowCentralUnitBean.class);
	@Inject
	FacesContext context;

	protected void initSpecialProperty() {
		Map<String, Object> session = context.getExternalContext()
				.getSessionMap();
		centralUnit = (CentralUnit) session
				.get(SecurityConst.CENTRALUNIT_SELECT_ROW_DATA);
		this.getCentralUnitProperty();
	}

	@BeforeRender
	public void beforeRender(boolean isPostback) {
		if (!isPostback) {
			this.initSpecialProperty();
		}
	}
}
